<{*账号管理*}>
<style>
	.uploader_account input{display: inline-block;width: 40px;position: relative;left:-30px;opacity: 0}
</style>
<div class="row">
	<div id="breadcrumb" class="col-md-12">
		<ol class="breadcrumb">
			<li><a href="#">Dashboard</a></li>
			<li><a href="#">Tables</a></li>
			<li><a href="#">Data Tables</a></li>
		</ol>
	</div>
</div>
<div class="row">
	<div class="col-xs-12">
		<div class="box">
			<div class="box-header">
				<div class="box-name">
					<i class="fa fa-usd"></i>
					<span>账号管理</span>
				</div>
				<div class="box-icons">
					<a class="collapse-link">
						<i class="fa fa-chevron-up"></i>
					</a>
					<a class="expand-link">
						<i class="fa fa-expand"></i>
					</a>
					<a class="close-link">
						<i class="fa fa-times"></i>
					</a>
				</div>
				<div class="no-move"></div>
			</div>
			<div class="box-content no-padding">
				<table class="table table-bordered table-striped table-hover table-heading table-datatable" id="datatable-1">
					<thead>
						<tr>
							<th>平台</th>
							<th>账号</th>
							<th>密码</th>
							<th>区服</th>
							<th>角色</th>
							<th>充值总额</th>
							<th>总游戏币</th>
							<th>充值天数</th>
							<th>优惠券</th>
							<th>实充金额</th>
							<th>手机编号</th>
							<th>充值方式</th>
							<th>最近充值时间</th>
							<th>状态</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
					<!-- Start: list_row -->
					<{foreach from=$list item=item}>
						<tr>
							<td><{$item['channel']}></td>
							<td><{$item['account']}></td>
							<td><{$item['password']}></td>
							<td><{$item['server']}></td>
							<td><{$item['role']}></td>
							<td><{$item['totalMoney']}></td>
							<td><{$item['totalGameMoney']}></td>
							<td><{$item['rechargeDays']}></td>
							<td><{$item['coupon']}></td>
							<td><{$item['totalMoney']-$item['coupon']}></td>
							<td><{$item['mobileNum']}></td>
							<td><{$item['rechargeType']}></td>
							<td><{$item['lastRechargeDate']}></td>
							<td><{$userStatus[$item['status']]}></td>
							<td><a href="javascript:void(0)" class="detail" account="<{$item['account']}>"  channel="<{$item['channel']}>">查看</a></td>
						</tr>

					<{/foreach}>

					<!-- End: list_row -->

					</tbody>
					<tfoot>
						<tr>
							<th>平台</th>
							<th>账号</th>
							<th>密码</th>
							<th>区服</th>
							<th>角色</th>
							<th>充值总额</th>
							<th>总游戏币</th>
							<th>充值天数</th>
							<th>优惠券</th>
							<th>实充金额</th>
							<th>手机编号</th>
							<th>充值方式</th>
							<th>最近充值时间</th>
							<th>状态</th>
							<th>操作</th>
						</tr>
					</tfoot>
				</table>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
// Run Datables plugin and create 3 variants of settings
function AllTables(){
	TestTable1();
	TestTable2();
	TestTable3();
	LoadSelect2Script(MakeSelect2);
}
function MakeSelect2(){
	$('select').select2();
	$('.dataTables_filter').each(function(){
		$(this).find('label input[type=text]').attr('placeholder', 'Search');
		$(this).append("<a class='uploader_account'>导入<input type='file' id='file1' name='file' /></a><span class='uptxt'></span> ")
		$('.uploader_account').uploader();
	});
}

var uploadURL='<{u("ajaxUpload?tp="|cat:$filefor)}>';
(function ($) {
	'use strict';
	$.fn.uploader = function () {
		return this.each(function () {
			var $this = $(this);
			var $file = $this.find('input[type=file]');
			var $txt = $this.next();
			$file.AjaxFileUpload({
				action: uploadURL,
				onSubmit: function () {
					$txt.text('上传中');
				},
				onComplete: function (filename, response) {
					if(response.status==0){
						$txt.text("上传成功");
						LoadAjaxContent("<{u(account)}>");
					}else{
						$txt.text(response.msg);

					}

				}
			});
		});
	}
})(jQuery);

$(document).ready(function() {
	// Load Datatables and run plugin on tables 
	LoadDataTablesScripts(AllTables);
	// Add Drag-n-Drop feature
	WinMove();
	$('.detail').on('click',function(){
		var $this=$(this);
		var channel=$this.attr('channel');
		var account=$this.attr('account');
		LoadAjaxContent("<{u('rechargeLog')}>"+'&account='+account+'&channel='+channel);
	})
});




</script>
